package pag.client.ui;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.SystemColor;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

public class GameButton extends JPanel
{

	private static final long serialVersionUID = -1582982910459595849L;
	private Image image;
	private Image sb;
	private Image sbHover;
	private Image pag;
	private Image pagHover;
	private Image poker;
	private Image pokerHover;
	
	/**
	 * Create the panel.
	 */
	public GameButton()
	{
		setBackground(SystemColor.menu);
		sb = new ImageIcon(this.getClass().getResource("/pag/resources/SunBeamLogo150x150.png")).getImage();
		sbHover = new ImageIcon(this.getClass().getResource("/pag/resources/SunBeamLogoHover150x150.png")).getImage();
		pag = new ImageIcon(this.getClass().getResource("/pag/resources/PagLogo150x150.png")).getImage();
		pagHover = new ImageIcon(this.getClass().getResource("/pag/resources/PagLogoHover150x150.png")).getImage();
		poker = new ImageIcon(this.getClass().getResource("/pag/resources/PokerLogo150x150.png")).getImage();
		pokerHover = new ImageIcon(this.getClass().getResource("/pag/resources/PokerLogoHover150x150.png")).getImage();
		
		// setzte den standardwert auf SBHover
		image = sbHover;
	}

	/**
	 * Zeichnet das Bild in das Panel.
	 */
	@Override
	protected void paintComponent(Graphics g)
	{
		super.paintComponent(g);
		g.drawImage(image, 0, 0, 150, 150, this);
	}
	
	/**
	 * Zeigt das SBHover Bild an.
	 */
	public void setSBHoverImage()
	{
		image = sbHover;
		this.repaint(0, 0, 150, 150);
	}
	
	/**
	 * Zeigt das SB Bild an.
	 */
	public void setSBImage()
	{
		image = sb;
		this.repaint(0, 0, 150, 150);
	}
	
	/**
	 * Zeigt das PagHover Bild an.
	 */
	public void setPagHoverImage()
	{
		image = pagHover;
		this.repaint(0, 0, 150, 150);
	}
	
	/**
	 * Zeigt das Pag Bild an.
	 */
	public void setPagImage()
	{
		image = pag;
		this.repaint(0, 0, 150, 150);
	}
	
	/**
	 * Zeigt das PokerHover Bild an.
	 */
	public void setPokerHoverImage()
	{
		image = pokerHover;
		this.repaint(0, 0, 150, 150);
	}
	
	/**
	 * Zeigt das Poker Bild an.
	 */
	public void setPokerImage()
	{
		image = poker;
		this.repaint(0, 0, 150, 150);
	}
}
